package com.iot.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import org.springframework.beans.factory.annotation.Value;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author wlr
 * @since 2022-01-05
 */
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 物联网实例Id
     */
    @TableField("iot_id")
    private String iotId="0jYaRW6CbNXPFpSaqaVrgr7900";
    /**
     * 实例Id
     */
    @Value("${iotInstanceId}")
    @TableField("iot_instance_id")
    private String iotInstanceId="iot-06z00fqphn6pwvp";
    /**
     * 产品名称
     */
    @TableField("product_name")
    private String productName;
    /**
     * 产品密钥
     */
    @TableId(value = "product_key", type = IdType.INPUT)
    private String productKey;
    /**
     * 节点类型
     */
    @TableField("node_type")
    private String nodeType;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime=LocalDateTime.now();
    /**
     * 用户Id
     */
    @TableField("user_id")
    private Integer userId=1;


    public String getIotId() {
        return iotId;
    }

    public void setIotId(String iotId) {
        this.iotId = iotId;
    }

    public String getIotInstanceId() {
        return iotInstanceId;
    }

    public void setIotInstanceId(String iotInstanceId) {
        this.iotInstanceId = iotInstanceId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductKey() {
        return productKey;
    }

    public void setProductKey(String productKey) {
        this.productKey = productKey;
    }

    public String getNodeType() {
        return nodeType;
    }

    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Product{" +
        ", iotId=" + iotId +
        ", iotInstanceId=" + iotInstanceId +
        ", productName=" + productName +
        ", productKey=" + productKey +
        ", nodeType=" + nodeType +
        ", createTime=" + createTime +
        ", userId=" + userId +
        "}";
    }

    public Product() {
    }

    public Product(String iotId, String iotInstanceId, String productName, String productKey, String nodeType, LocalDateTime createTime, Integer userId) {
        this.iotId = iotId;
        this.iotInstanceId = iotInstanceId;
        this.productName = productName;
        this.productKey = productKey;
        this.nodeType = nodeType;
        this.createTime = createTime;
        this.userId = userId;
    }
}
